Skip to content

Conversation

jannikpflieger
Copy link
Contributor

@jannikpflieger jannikpflieger commented Mar 24, 2025

Description

Added the ability to separate the collection of Clifford and non Clifford Blocks by adding a new function parameter. For that a isCliffordCheck was added as well. The isClifford check is very rough but includes all common Clifford gates. However, it does not include rotation gates that with the right angle could be considered Clifford. It does not include custom gates that could be Clifford as well.

The separation is done by finalizing a block when we iterate over a non-Clifford Block. When we want to collect Clifford and non Clifford gates separately then the function handles non-Clifford gates as "cannot be processed" and the canProcess variable is set to false. This ensures that we still have large CliffordBlocks but we have only single non CliffordBlocks. Essentially separating the non-CliffordBlocks from all Clifford and other non-CliffordBlocks.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

Copy link

codecov bot commented Mar 24, 2025

Codecov Report

❌ Patch coverage is 99.18699% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
include/mqt-core/ir/operations/Operation.hpp 0.0% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@burgholzer burgholzer changed the title Collect clifford blocks ✨ Collect clifford blocks Apr 7, 2025
@burgholzer burgholzer added enhancement New feature or request Core Anything related to the Core library and IR c++ Anything related to C++ code labels Apr 7, 2025
@burgholzer burgholzer added this to the MQT Core milestone Apr 7, 2025
Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this initial PR 🙏🏼
I just went through everything and left a couple of inline comments. This still needs a bit of work before it is ready to be merged.
Don't hesitate to ask if you should have any questions.

@burgholzer
Copy link
Member

@jannikpflieger any updates on this? it's been three weeks since the review above 😌

@jannikpflieger
Copy link
Contributor Author

@burgholzer still doing it, since I was on vacation + exam, but I'm on it! I'm back since yesterday evening :D

Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for another iteration here. To be fair and honest, the implementation here still looks way to complicated compared to what I had in mind. At least, it seems to be doing the correct thing now though. So I'd propose the following: I left a couple of minor inline comments on the tests to clarify some things and improve the clarity of the tests. Once addressed, let's get this merged and close this chapter.

Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a couple of touch ups as well as a changelog entry.
Let's get this in 🚀

Thanks for the contribution! Much appreciated 🙏🏼

@burgholzer burgholzer enabled auto-merge (squash) August 27, 2025 14:49
@burgholzer burgholzer merged commit 110584e into munich-quantum-toolkit:main Aug 27, 2025
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Anything related to C++ code Core Anything related to the Core library and IR enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants